const execa = require('execa');
require('colors');

exports.getGitBranchName = () => {
  try {
    const res = execa.commandSync('git branch --show-current');
    return res.stdout;
  } catch (e) {
    if (e.stderr) {
      console.error(e.stderr.red);
    } else {
      console.error(e.shortMessage.red);
    }
    return false;
  }
};
